package com.itany.mall.entity;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Product extends MallData implements Cloneable, Serializable {
	private static final long serialVersionUID = 1L;
	// private Long id;
	private String name;
	private Double price;
	private Integer num;
	private Long typeId;
	private ProductType type;
	// 冗余

	@Override
	public Object clone() {
		try {
			Product p = (Product) super.clone();
			p.type = (ProductType) this.type.clone();
			return p;
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
			return null;
		}
	}
}
